<template>
  <!-- 总部反馈说明 -->
  <div>
     <!-- table -->
    <FilterTable   
        ref="table" 
        :columns="columns"   
        :fetchapi="fetchApi" 
        :isSelectColumn="isSelectColumn"
        :params="fetchParams" 
        :datakey="'records'"
        columnsRef='origin_construct_inquire_oemFeedback_01'
        :onColumnsChange="columns => this.columns = columns">
   </FilterTable>
    <div class="dialogBottmView">
      <el-button @click="closeDialog">关闭</el-button>
    </div>
  </div>
</template>
<script>
import { dictionary } from '@/utils/dictMixin';
import { searchDealerApplyOemFeedback} from '@/api/cms-api/origin/construct/dealer';
export default {
  components: {
  },
  mixins: [dictionary],
  props: {
    value:{
        type: Object,
        default: null
    }
  },
  data() {
    return {
      formData:[],
      visible:false,
      isSelectColumn:false,
      infoId:null,
      topFilterInit:this.topFilterInitFun(),
      fetchParams:{'applyId':this.value.applyId},  //参数
      initData: {},
      columns:this.creatHeader(),
      fetchApi: searchDealerApplyOemFeedback
    };
  },
  mounted() {
    this.BaseTable = this.$refs.table.$refs.pageTable;
  },
  methods: {
      //搜索数据
      topFilterInitFun(){
        return [
            { title: '执行反馈状态', dataIndex: 'field2', sorter: true ,
              render: props => {    //编码转汉字
                return <span>{this.createDictText(props.row.basedataRelateId, '1611')}</span>;
            }},
            { title: '周度', dataIndex: 'field3', sorter: true },
            { title: '时间', dataIndex: 'field4',dateFormat:'yyyy-MM-dd', sorter: true},
            { title: '进度说明', dataIndex: 'field5', sorter: true},
            { title: '整改项目', dataIndex: 'field6', sorter: true}
        ]
      },
      //搜索获取数据
      changeHandle(val){
        this.fetchParams = Object.assign({},val);
      },
      //table表头和数据源
      creatHeader(){
         return [
          {
            title: '序号',
            dataIndex: 'index',
            width: 80,
            sorter: true,
            render: props => {
              return <span>{props.row.index + 1}</span>;
            }
          },
          { title: '执行反馈状态', dataIndex: 'feedbackStatus', sorter: true ,
              render: props => {    //编码转汉字
                return <span>{this.createDictText(props.row.feedbackStatus, '2549')}</span>;
            }},
          { title: '周度', dataIndex: 'feedbackWeek', sorter: true ,
              render: props => {    //编码转汉字
                return <span>{this.createDictText(props.row.feedbackWeek, '2576')}</span>;
            }},
          { title: '时间', dataIndex: 'feedbackTime',dateFormat:'yyyy-MM-dd', sorter: true},
          { title: '进度说明', dataIndex: 'processDesc', sorter: true},
          { title: '整改项目', dataIndex: 'reformItem', sorter: true}
        ]
      },
    formChangeHandle(data){
      this.formData = data;
    },
    //取消操作
    closeDialog(type) {
      this.$emit('close', { visible: false,type:type});
    },
    collapseHandle() {
      this.$nextTick(() => {
        this.BaseTable.EXECUTE_RESET_HEIGHT();
      });
    }
  }
};
</script>

<style lang="less" scoped>
</style>
